package baseClass;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import mainSrc.MainDirector;

public class Sprite_Default
{
  public float PaintAlpha;
  public float PaintdAlpha;
  public Bitmap bit_img;
  public int img_x;
  public int img_y;
  public boolean isFadeIn;
  public boolean isFadeInComplete;
  public boolean isFadeOut;
  public boolean isFadeOutComplete;
  public boolean isMove;
  public boolean isMoveComplete;
  public boolean isMoveDestination;
  public boolean isSceneChanged;
  public Paint paint;
  public float position_ax;
  public float position_ay;
  public float position_destx;
  public float position_desty;
  public float position_dx;
  public float position_dy;
  public float position_x;
  public float position_y;
  public int res_id;
  public int state;
  public boolean visible;
  
  public Sprite_Default() {}
  
  public Sprite_Default(int paramInt1, int paramInt2, int paramInt3, float paramFloat1, float paramFloat2)
  {
    Setting(paramInt1, paramInt2, paramInt3, paramFloat1, paramFloat2);
    setBitmap(paramInt1);
  }
  
  public Sprite_Default(Bitmap paramBitmap, int paramInt1, int paramInt2, float paramFloat1, float paramFloat2)
  {
    Setting(this.res_id, paramInt1, paramInt2, paramFloat1, paramFloat2);
    this.bit_img = paramBitmap;
    this.bit_img = Bitmap.createScaledBitmap(this.bit_img, Math.round(paramInt1 * Global.GetInstance().dnst_w), Math.round(paramInt2 * Global.GetInstance().dnst_h), true);
  }
  
  public float AToB(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4)
  {
    return (paramFloat1 - paramFloat3) * (paramFloat1 - paramFloat3) + (paramFloat2 - paramFloat4) * (paramFloat2 - paramFloat4);
  }
  
  public void AlwaysRun()
  {
    update();
  }
  
  public void DrawSprite(Canvas paramCanvas)
  {
    if ((this.visible) && (this.bit_img != null)) {
      paramCanvas.drawBitmap(this.bit_img, this.position_x * Global.GetInstance().dnst_w - this.bit_img.getWidth() * this.position_ax, this.position_y * Global.GetInstance().dnst_h - this.bit_img.getHeight() * this.position_ay, this.paint);
    }
  }
  
  public void Setting(int paramInt1, int paramInt2, int paramInt3, float paramFloat1, float paramFloat2)
  {
    this.state = 1;
    this.visible = true;
    setPosition(paramFloat1, paramFloat2);
    setPositionD(0.0F, 0.0F);
    setPositionA(0.5F, 0.5F);
    this.position_destx = 0.0F;
    this.position_desty = 0.0F;
    this.res_id = paramInt1;
    this.img_x = paramInt2;
    this.img_y = paramInt3;
    this.PaintAlpha = 255.0F;
    this.PaintdAlpha = 0.0F;
    this.isMoveDestination = false;
    this.isMoveComplete = false;
    this.isFadeInComplete = false;
    this.isFadeOutComplete = false;
    this.isFadeIn = false;
    this.isFadeOut = false;
    this.isMove = false;
    this.isSceneChanged = false;
    this.paint = new Paint();
    this.paint.setAlpha((int)this.PaintAlpha);
  }
  
  public boolean Touch_Check(float paramFloat1, float paramFloat2)
  {
    return (paramFloat1 >= this.position_x * Global.GetInstance().dnst_w - this.bit_img.getWidth() * this.position_ax) && (paramFloat2 >= this.position_y * Global.GetInstance().dnst_h - this.bit_img.getHeight() * this.position_ay) && (paramFloat1 <= this.position_x * Global.GetInstance().dnst_w - this.bit_img.getWidth() * (this.position_ax - 1.0F)) && (paramFloat2 <= this.position_y * Global.GetInstance().dnst_h - this.bit_img.getHeight() * (this.position_ay - 1.0F));
  }
  
  public void onTouch_Down(float paramFloat1, float paramFloat2, MainDirector paramMainDirector) {}
  
  public void onTouch_Move(float paramFloat1, float paramFloat2, MainDirector paramMainDirector) {}
  
  public void onTouch_Up(float paramFloat1, float paramFloat2, MainDirector paramMainDirector) {}
  
  public void recycleBitmap()
  {
    if (this.bit_img != null)
    {
      this.bit_img.recycle();
      this.bit_img = null;
    }
  }
  
  public void sceneChange()
  {
    sceneStart();
    this.isSceneChanged = true;
  }
  
  public void sceneStart() {}
  
  public void setBitmap(int paramInt)
  {
    this.bit_img = BitmapFactory.decodeResource(Global.GetInstance().m_context.getResources(), paramInt);
    this.bit_img = Bitmap.createScaledBitmap(this.bit_img, Math.round(this.img_x * Global.GetInstance().dnst_w), Math.round(this.img_y * Global.GetInstance().dnst_h), true);
  }
  
  public void setBitmap(Bitmap paramBitmap)
  {
    this.bit_img = paramBitmap;
    this.bit_img = Bitmap.createScaledBitmap(this.bit_img, Math.round(this.img_x * Global.GetInstance().dnst_w), Math.round(this.img_y * Global.GetInstance().dnst_h), true);
  }
  
  public void setPosition(float paramFloat1, float paramFloat2)
  {
    this.position_x = paramFloat1;
    this.position_y = paramFloat2;
  }
  
  public void setPositionA(float paramFloat1, float paramFloat2)
  {
    this.position_ax = paramFloat1;
    this.position_ay = paramFloat2;
  }
  
  public void setPositionD(float paramFloat1, float paramFloat2)
  {
    this.position_dx = paramFloat1;
    this.position_dy = paramFloat2;
  }
  
  public void startFadeIn(float paramFloat)
  {
    this.PaintAlpha = 0.0F;
    this.PaintdAlpha = (255.0F / paramFloat);
    this.isFadeIn = true;
    this.isFadeOut = false;
  }
  
  public void startFadeOut(float paramFloat)
  {
    this.PaintAlpha = 255.0F;
    this.PaintdAlpha = (255.0F / paramFloat);
    this.isFadeIn = false;
    this.isFadeOut = true;
  }
  
  public void startMove()
  {
    this.isMove = true;
  }
  
  public void startMove(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    this.position_destx = paramFloat1;
    this.position_desty = paramFloat2;
    this.position_dx = ((paramFloat1 - this.position_x) / paramFloat3);
    this.position_dy = ((paramFloat2 - this.position_y) / paramFloat3);
    this.isMove = true;
    this.isMoveDestination = true;
  }
  
  public void startMoveDelta(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    this.position_destx = (this.position_x + paramFloat1);
    this.position_desty = (this.position_y + paramFloat2);
    this.position_dx = ((this.position_destx - this.position_x) / paramFloat3);
    this.position_dy = ((this.position_desty - this.position_y) / paramFloat3);
    this.isMove = true;
    this.isMoveDestination = true;
  }
  
  public void stopMove()
  {
    this.isMove = false;
  }
  
  public void update() {}
}


/* Location:           D:\Tool\AndroidKiller_v1.3.1\projects\petdesigner\ProjectSrc\classes-dex2jar.jar
 * Qualified Name:     baseClass.Sprite_Default
 * JD-Core Version:    0.7.0.1
 */